function r = oneBitErr(c)
  r = c;
  len = length(c);
  pos = int(len*rand() + 1);
  r(pos) = ~c(pos);
endfunction
